ZCU-PUB/Make Solr heap tunable via SOLR_HEAP (backport #1309)#1325
Conversation
Backport of #1309 to customer/zcu-pub. Translate (not cherry-pick) the single Solr heap line against this branch's actual compose file: the launch uses -p 898${INSTANCE}, so only the -m 4g argument is changed to -m ${SOLR_HEAP:-4g}. With SOLR_HEAP unset the 4g default is preserved; AlwaysPreTouch no longer forces the full 4g commit when a smaller heap is set. Refs dataquest-dev/dspace-customers#746 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR makes the Solr JVM heap size configurable in the dev/test Docker Compose setup by replacing a hardcoded heap value with a ${SOLR_HEAP:-4g} defaulted variable, keeping existing behavior unchanged when the variable is not set.
Changes:
- Replace hardcoded
-m 4gwith-m "${SOLR_HEAP:-4g}"in thedspacesolrentrypoint command. - Preserve the prior default heap size (
4g) while enabling operators to override via Compose variable interpolation.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Problem
The Solr heap in
docker/docker-compose-rest.ymlis hardcoded to-m 4g. Combined with-XX:+AlwaysPreTouch, the container commits the full 4 GB on start, which is wasteful onshared dev hosts running several DSpace stacks. Operators cannot lower the heap without
editing a tracked file.
Backport of #1309 to
customer/zcu-pub.Tracking issue: dataquest-dev/dspace-customers#746
Root cause
The Solr launch command was written with a literal heap argument (
-m 4g) instead of anenvironment-driven one, so there is no runtime knob and
AlwaysPreTouchforces the fullallocation up front.
Change set
Single-line change to the
dspacesolrentrypoint indocker/docker-compose-rest.yml:Translated, not cherry-picked (per the FE backport model). On this branch (7.6.1 family)
the Solr launch uses
-p 898${INSTANCE}, not the source PR's-p 8983, so only the-m 4gargument was changed; the port and every other line are untouched. The value is quoted
(
"${SOLR_HEAP:-4g}") to survive word-splitting, matching the source PR's follow-up fix.Intentionally out of scope: the default heap value (stays
4g), other services, ports,Solr image/version, and
AlwaysPreTouch.Test evidence
Static fingerprints:
Compose render (Docker Compose interpolates
${SOLR_HEAP:-4g}, demonstrating both paths;INSTANCE=0set only to silence unset-var noise):Default preserved (4g), override honored (1g), YAML/interpolation valid.
Risk & rollback
be an unquoted/typo'd interpolation; mitigated by the quoting and the compose-render check above.
SOLR_HEAPreproduces the prior 4 GB behavior exactly;existing
.env/compose overrides that don't setSOLR_HEAPkeep working.Notes / assumptions
27253a3env var,0d652dcquoting).customer/mendelufrom the tracking issue is not included: that branch(DSpace 9.1) launches Solr via
solr-foregroundand has no hardcoded-m 4gline totranslate, so the backport does not apply there. Reported separately on the tracking issue.
🤖 Generated with Claude Code